﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using CMS.BLL;

public partial class Controls_Hotel_ctrHotelNavigation : System.Web.UI.UserControl
{
    private int nCurrentLanguage = Support.GetCurrentLanguage();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.SetLabel();
        }
    }
    private void SetLabel()
    {
        lnkHome.Text = MultipleLanguage.HOME[nCurrentLanguage - 1];
        int nCountry = ConvertData.ConvertToInt(Request.QueryString["cid"]);
        lnkHotel.Text = MultipleLanguage.HOTEL[nCurrentLanguage - 1];
        if (nCountry == 0)
            nCountry = 1;
        switch (nCountry)
        {
            case 1:
                lnkCountry.Text = "Vietnam";
                lnkCountry.NavigateUrl = "~/Default.aspx?cid=1";
                lnkHome.NavigateUrl = "~/Default.aspx?cid=1";
                lnkHotel.NavigateUrl = "~/Hotel.aspx?cid=1";
                break;
            case 2:
                lnkCountry.Text = "Laos";
                lnkCountry.NavigateUrl = "~/Default.aspx?cid=2";
                lnkHome.NavigateUrl = "~/Default.aspx?cid=2";
                lnkHotel.NavigateUrl = "~/Hotel.aspx?cid=2";
                break;
            case 3:
                lnkCountry.Text = "Cambodia";
                lnkCountry.NavigateUrl = "~/Default.aspx?cid=3";
                lnkHome.NavigateUrl = "~/Default.aspx?cid=3";
                lnkHotel.NavigateUrl = "~/Hotel.aspx?cid=3";
                break;
        }

        int nHotelID = ConvertData.ConvertToInt(Request.QueryString[Config.HOTELID]);

        if (nHotelID != 0 )
        {
            ltrHotelDetail.Visible = true;
            Hotel objHotel = new Hotel();
            objHotel.LoadById(nHotelID);
 

                switch (nCurrentLanguage)
                {
                    case 1:
                        ltrHotelDetail.Text = "<img src=\"images/Layout/ico-bullet-3.png\" />" + objHotel.Data.Title1;
                        break;
                    case 2:
                        ltrHotelDetail.Text = "<img src=\"images/Layout/ico-bullet-3.png\" />" + objHotel.Data.Title2;
                        break;
                    case 3:
                        ltrHotelDetail.Text = "<img src=\"images/Layout/ico-bullet-3.png\" />" + objHotel.Data.Title3;
                        break;
              
            }

        }
        else { ltrHotelDetail.Visible = false; }

    }
}